<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center confirmOrder_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub confirmOrder_fd0_0'>
					<view class='flex flex-wrap align-center confirmOrder_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  confirmOrder_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-stretch justify-center'>
						<text class='confirmOrder_fd0_0_c1_c0'>确认订单</text>
					</view>
					<view class='flex flex-wrap align-center justify-end confirmOrder_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			
			<view class="loading_css" v-if="isShow">
				<u-loading size="36" color="#3090FF"></u-loading>
				<view>加载中</view>
			</view>
			<template v-else>
				<!---flex布局flex布局开始-->
				<view class="flex flex-direction align-stretch benben-flex-layout confirmOrder_flex_1">
					<view class='flex flex-direction align-stretch confirmOrder_fd1_0'>
						<view class='flex'>
							<view class='flex flex-wrap align-center'>
								<image class='confirmOrder_fd1_0_c0_c0_c0' mode="aspectFill" :src='courseInfo.thumb'>
								</image>
							</view>
							<view class='confirmOrder_fd1_0_c0_c1'>
								<view class='flex flex-wrap align-center'>
									<text class='confirmOrder_fd1_0_c0_c1_c0_c0'>{{courseInfo.title}}</text>
								</view>
								<view class='flex flex-wrap align-center'>
									<text class='confirmOrder_fd1_0_c0_c1_c1_c0'>{{courseInfo.synopsis}}</text>
								</view>
								<view class='flex flex-wrap align-center'>
									<text class='confirmOrder_fd1_0_c0_c1_c2_c0'>￥</text>
									<text class=' confirmOrder_fd1_0_c0_c1_c2_c1'>
										<text class=' confirmOrder_price1_fd1_0_c0_c1_c2_c1'>{{ courseInfo.price | frontPrice }}</text>
										<text class=' confirmOrder_price2_fd1_0_c0_c1_c2_c1'>{{ courseInfo.price | laterPrice }}</text>
									</text>
								</view>
							</view>
						</view>
						<view class='flex flex-wrap align-center confirmOrder_fd1_0_c1'>
							<text>备注</text>
						</view>
						<view class='flex flex-wrap align-center'>
							<view class='flex flex-wrap confirmOrder_fd1_0_c2_c0'>
								<textarea class='flex confirmOrder_input_fd1_0_c2_c0' :placeholder="'请输入'" :maxlength="240"
									:show-num='true' placeholder-style="color:#999;font-size:28rpx" v-model="fd1_0_c2_c0" />
								<template>
									<view class='flex flex justify-end'>
									</view>
								</template>
							</view>
						</view>
					</view>
				</view>
				
				<!---flex布局flex布局结束-->
				<!---flex布局flex布局开始-->
				<view class="flex benben-flex-layout flex-wrap align-center confirmOrder_flex_2">
				</view>
				
				<!---flex布局flex布局结束-->
				<!---flex布局flex布局开始-->
				<view class="flex flex-wrap align-center justify-between benben-flex-layout confirmOrder_flex_3">
					<view class='flex flex-wrap align-center'>
						<text class='confirmOrder_fd3_0_c0'>总计：</text>
						<text class='confirmOrder_fd3_0_c1'>￥</text>
						<text class=' confirmOrder_fd3_0_c2'>
							<text class=' confirmOrder_price1_fd3_0_c2'>{{ courseInfo.price | frontPrice }}</text>
							<text class=' confirmOrder_price1_fd3_0_c2'>{{ courseInfo.price | laterPrice }}</text>
						</text>
					</view>
					<view class='flex flex-wrap align-center justify-center confirmOrder_fd3_1' @tap.stop="buyCourse">
						<text>提交订单</text>
					</view>
				</view>
				
				<!---flex布局flex布局结束-->
			</template>

		</view>
	</view>
</template>
<script>
	export default {
		components: {},


		data() {
			return {
				"isShow": true,
				"fd1_0_c2_c0": "",
				"aid": "",
				"courseInfo": {},
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			let {aid} = options;
			if (aid !== undefined) this.aid = aid;
			this.getDetails();
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			getDetails() {
				this.$api.post(global.apiUrls.post65743bb4bfd8a, {
					aid: this.aid
				}).then(res => {
					this.isShow = false;
					console.log(res);
					if (res.data.code == 1) {
						this.courseInfo = res.data.data;
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			buyCourse() {
				this.$api.post(global.apiUrls.post65783c2239e0e, {
					course_id: this.aid,
					remark: this.fd1_0_c2_c0
				}).then(res => {
					if (res.data.code == 1) {
						uni.redirectTo({
							url: '/pages/sy/offerPay/offerPay?money='+ res.data.data.price + '&order_sn=' + res.data.data.order_sn + '&time=' + res.data.data.pay_timeout
						})
					} else {
						this.$message.info(res.data.msg);
					}
				})
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #F8F8F8;
		background-size: 100% auto;
	}

	.confirmOrder_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.confirmOrder_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
		line-height: 50rpx;
	}

	.confirmOrder_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: #333;
	}

	.confirmOrder_fd0_0_c0 {
		width: 120rpx;
	}

	.confirmOrder_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.confirmOrder_flex_1 {
		padding: 24rpx 30rpx 24rpx 30rpx;
	}

	.confirmOrder_input_fd1_0_c2_c0 {
		width: 100%;
		height: 170rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333;
		white-space: pre-wrap;
	}

	.confirmOrder_fd1_0_c2_c0 {
		background: #F8F8FA;
		width: 650rpx;
		padding: 10rpx 10rpx 0rpx 16rpx;
		border-radius: 16rpx;
	}

	.confirmOrder_fd1_0_c1 {
		margin: 40rpx 0rpx 24rpx 0rpx;
		font-size: 32rpx;
		font-weight: 700;
	}

	.confirmOrder_price2_fd1_0_c0_c1_c2_c1 {
		font-size: 34rpx;
		color: rgba(255, 70, 32, 1);
	}

	.confirmOrder_price1_fd1_0_c0_c1_c2_c1 {
		color: rgba(255, 70, 32, 1);
		font-size: 34rpx;
	}

	.confirmOrder_fd1_0_c0_c1_c2_c1 {
		color: #ff5536;
		font-weight: 600;
	}

	.confirmOrder_fd1_0_c0_c1_c2_c0 {
		font-size: 22rpx;
		color: rgba(255, 70, 32, 1);
		font-weight: 700;
	}

	.confirmOrder_fd1_0_c0_c1_c1_c0 {
		font-size: 24rpx;
		color: rgba(167, 166, 167, 1);
		-webkit-line-clamp: 2;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		margin: 8rpx 0rpx 30rpx 0rpx;
	}

	.confirmOrder_fd1_0_c0_c1_c0_c0 {
		font-size: 32rpx;
		font-weight: 700;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
	}

	.confirmOrder_fd1_0_c0_c1 {
		padding: 4rpx 0rpx 0rpx 24rpx;
	}

	.confirmOrder_fd1_0_c0_c0_c0 {
		width: 260rpx;
		height: 200rpx;
		border-radius: 16rpx;
	}

	.confirmOrder_fd1_0 {
		background: var(--benbenbgColor1);
		border-radius: 16rpx;
		background-size: 100% auto;
		padding: 24rpx;
	}

	.confirmOrder_flex_2 {
		position: fixed;
		bottom: calc(0rpx + var(--window-bottom));
	}

	.confirmOrder_flex_3 {
		position: fixed;
		bottom: calc(0rpx + var(--window-bottom));
		width: 100%;
		height: 90rpx;
		padding: 0rpx 0rpx 0rpx 32rpx;
	}

	.confirmOrder_fd3_1 {
		background: var(--benbenbgColor0);
		width: 280rpx;
		line-height: 90rpx;
		height: 90rpx;
		font-size: 32rpx;
		background-size: 100% auto;
		color: var(--benbenFontColor3);
	}

	.confirmOrder_price1_fd3_0_c2 {
		font-size: 34rpx;
		color: rgba(255, 70, 32, 1);
	}

	.confirmOrder_fd3_0_c2 {
		color: #ff5536;
		font-weight: 600;
	}

	.confirmOrder_fd3_0_c1 {
		font-size: 22rpx;
		color: rgba(255, 70, 32, 1);
		font-weight: 700;
	}

	.confirmOrder_fd3_0_c0 {
		font-size: 28rpx;
	}
</style>